<?php $this->renderPartial('_tabs'); ?>
<script>
	var agencyId = <?php echo $advertisement->agency_id; ?>;
</script>

<div class="grid_16">
	<h1 class="float-left">Review Advertisement</h1>
</div>

<div class="activate-structure form">
	<?php
	$form = $this->beginWidget('PsActiveForm', array(
		'id' => 'manage-accounts-addtax-form',
		'enableAjaxValidation' => FALSE
			));
	?>
	<div class="grid_10">
		<div class="section">
			<div class="block">
				<div class="row">
					<h4><?php echo $form->labelEx($advertisement, 'ad_message', array('label' => 'Submitted Message')); ?></h4>
					<?php echo $form->textArea($advertisement, 'ad_message', array('style' => 'width: 100%', 'rows' => '5', 'disabled' => 'disabled')); ?>
					<?php echo $form->error($advertisement, 'ad_message'); ?>
				</div>
				<div class="row clearfix">
					<div id="rating" class="float-right" title="Score">
						<div id="rating-label" class="align-center">Score</div>
						<div id="rating-percentage"><?php echo $advertisement->rejection_score; ?></div>
					</div>
					<div id="adsim" class="float-left">
						<div class="block">
							<h4>Preview</h4>
							<span></span>
						</div>
					</div>
				</div>
				<label>Filtered / Banned Words</label>
				<div class="" id="badWords">
					<div class="block">
						<span></span>
					</div>
				</div>
				<table class="form-table">
					<tr>
						<td><div id="badWords"></div></td>
					</tr>
					<tr>
						<th width="200" scope="row">
							<?php echo $form->labelEx($advertisement, 'approval_status', array('label' => 'Status')); ?>
						</th>
						<td scope="row" width="160">
							<?php
							echo $form->radioButtonList($advertisement, 'approval_status', array('2' => 'Approved', '1' => 'Rejected'), array('separator' => ''));
							?>

						</td>
					</tr>
					<tr>
						<th width="200" scope="row">
							<?php echo $form->labelEx($advertisement, 'status_remarks', array('label' => 'Reasons and Comments')); ?>
						</th>

						<td>
							<?php echo $form->textArea($advertisement, 'status_remarks', array('cols' => '48', 'rows' => '3')); ?>
							<?php echo $form->error($advertisement, 'status_remarks'); ?>
						</td>
					</tr>
					<tr>
						<th width="200" scope="row">
							Uploaded Image
						</th>
						<td title="View Image">
							<a class="with-icon green" href="<?php echo $this->createUrl('/adsControl/allAds'); ?>">
								<img width="20" height="16" src="/images/icons/farmfresh/32x32/photo.png" />
							</a>
						</td>
					</tr>
					<tr>
						<th scope="row">
							<button type="submit" id="update-status" class="link-button round_all no-margin" disabled>
								<span>Update Status</span>
							</button>
						</th>
						<td></td>
					</tr>
				</table>
			</div>
		</div>
	</div>
	<div class="grid_6">
		<div class="section highlighted">
			<div class="block">
				<table class="form-table">
					<tr>
						<td>
							<div class="">
								<?php echo $form->labelEx($advertisement, 'launch_date', array('label' => 'Target Date to Launch')); ?><br/>
								<?php
								$form->widget('PsJuiDatePicker', array(
									'model' => $advertisement,
									'attribute' => 'launch_date',
									'htmlOptions' => array(
										'disabled' => true
									),
									'options' => array(
										'showButtonPanel' => false,
										'changeYear' => true,
										'dateFormat' => 'dd-mm-yy',
									),
								));
								?>
								<?php echo $form->error($advertisement, 'launch_date'); ?>
							</div>

						</td>
					</tr>
					<tr>
						<td>
							<div>
								<?php echo $form->labelEx($advertisement, 'ad_type_code', array('label' => 'Advertisement Type')); ?><br/>
								<?php echo $form->dropDownList($advertisement, 'ad_type_code', Advertisement::getAdTypeListData(), array('disabled' => true)); ?>
								<?php echo $form->error($advertisement, 'ad_type_code'); ?>
							</div>
						</td>
					</tr>
					<tr>
						<td>
							<div>
								<?php echo $form->labelEx($advertisement, 'agent_remarks', array('label' => "Agent's Remarks")); ?>
								<?php echo $form->textArea($advertisement, 'agent_remarks', array('cols' => '30', 'rows' => '5', 'style' => 'width: 100%', 'disabled' => 'disabled')); ?>
								<?php echo $form->error($advertisement, 'agent_remarks'); ?>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
	<?php $this->endWidget(); ?>
</div>
